package com.example.shardingjdbc.controller;

import com.example.shardingjdbc.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/test")
public class TestController {
	@Autowired
	private OrderService orderService;
	
	@RequestMapping(value = "/query", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
	public String query(){
		return "张三";
	}
	
	@RequestMapping(value = "/insert")
	public String insert(){
		return orderService.insertOrder();
	}
}
